home *** CD-ROM | disk | FTP | other *** search
/ START Magazine / START VOL 4 NO 6.st / DRIVER.ARC / DRIVER.LST next >
Encoding:
File List  |  1989-10-11  |  31.5 KB  |  1,517 lines

  1. '
  2. '                            GFA PRINTER DRIVER
  3. '
  4. '                                by Know Ware Mfg.
  5. '                   Copyright 1990 Antic Publishing, Inc.
  6. '
  7. ' ===========================================================================
  8. '
  9. Cls
  10. On Error Gosub Fixit
  11. Rez%=Xbios(4)
  12. If Rez%
  13.   @Memory
  14.   '
  15.   Antic$="© 1990 Antic Publishing"
  16.   '
  17.   @Save_pal
  18.   Setcolor 2,0,4,6
  19.   Setcolor 1,6,5,0
  20.   Dim Pd$(30)
  21.   Dim Pd1$(30)
  22.   Dim Emess$(7)
  23.   '
  24.   Message_data:
  25.   Data *File Not Found,*Path Not Found,*Access Not Possible,*Invalid Drive I.D.
  26.   Data End of File Reached,Diskette Full,Resume Not Possible
  27.   Restore Message_data
  28.   For I%=1 To 7
  29.     Read Emess$(I%)
  30.   Next I%
  31.   '
  32.   Void Bios(11,Bios(11,-1) Or &H10) !  Caps Lock On
  33.   @Read_config
  34.   @Use_path
  35.   If Rez%=2
  36.     Deffill 1,2,4
  37.   Else
  38.     Deffill 0,1,0
  39.   Endif
  40.   Pbox 0,0,640,200*Rez%
  41.   Sget Temp$
  42.   @Assign
  43.   First_flag%=1
  44.   @Title_screen
  45.   Entry:
  46.   @Main_loop
  47.   @Leave
  48. Else
  49.   Alrt$="This Program Will *NOT*|Run in Low Resolution !"
  50.   Alert 3,Alrt$,1,"QUIT",B%
  51. Endif
  52. Cls
  53. Edit
  54. '
  55. ' ================================================================
  56. '
  57. Procedure Title_screen
  58.   @Set3
  59.   @Dialog3
  60. Return
  61. '
  62. Procedure Main_loop
  63.   Repeat
  64.     @Set1
  65.     @Dialog1
  66.     @Translate1
  67.   Until Ex1%=Mquit%
  68. Return
  69. '
  70. ' ==========================================================
  71. '
  72. Procedure Null
  73. Return
  74. '
  75. Procedure Make
  76.   @Set0
  77.   @Dialog0
  78.   @Translate0
  79. Return
  80. '
  81. Procedure Change
  82.   @Blank_array
  83.   @Blank_hold_array
  84.   @Driver_pick
  85.   @Driver_load
  86.   Tail_check$=Upper$(Right$(Pfilename$,3))
  87.   If Pfilename$<>"" And (Tail_check$="PDA" Or Tail_check$="PDX")
  88.     @Par_tran
  89.     Change_flag%=1
  90.     @Make
  91.   Endif
  92. Return
  93. '
  94. Procedure Hcopy
  95.   Alrt$="Test the Driver,|Print Out It's Parameters,|or Exit."
  96.   Alert 2,Alrt$,0,"TEST|LIST|EXIT",B%
  97.   On B% Gosub Print_test,Print_list,Null
  98. Return
  99. '
  100. Procedure Make_path
  101.   @Set2
  102.   @Dialog2
  103.   @Translate2
  104. Return
  105. '
  106. Procedure Make_active
  107.   @Active_show
  108.   @Driver_pick
  109.   @Activate
  110. Return
  111. '
  112. Procedure Leave
  113.   Close
  114.   @Rsrc_free
  115.   @Restore_pal
  116.   @Memory_back
  117.   Cls
  118.   Edit
  119. Return
  120. '
  121. ' =============================================================
  122. '
  123. Procedure Set0
  124.   '
  125.   @Sstate(Tree0%,Cquit%,0)
  126.   @Sstate(Tree0%,Credo%,0)
  127.   @Sstate(Tree0%,Caccept%,0)
  128.   '
  129.   If Con_hex%
  130.     @Dec_to_hex
  131.   Endif
  132.   If Con_char%
  133.     @Dec_to_char
  134.   Endif
  135.   @Stext(Tree0%,Cname%,Pd$(2))
  136.   For I%=4 To 16
  137.     @Stext(Tree0%,I%,Pd$(I%))
  138.     @Stext(Tree0%,I%+14,Pd$(I%+14))
  139.   Next I%
  140.   '
  141. Return
  142. Procedure Dialog0
  143.   Do
  144.     @Objc_draw(Tree0%,0,6,X0%,Y0%,B0%,H0%)
  145.     @Form_do(Tree0%,2)
  146.     Ex0%=Dpeek(Gintout)
  147.     @Sstate(Tree0%,Ex0%,0)
  148.     Exit If Ex0%=Cquit% Or Ex0%=Credo% Or Ex0%=Caccept%
  149.   Loop
  150.   '  Sput Temp$
  151.   '
  152. Return
  153. Procedure Translate0
  154.   '
  155.   If Ex0%=Caccept%
  156.     Sput Temp$
  157.     @Gem_to_string
  158.     If Con_hex%
  159.       @Hex_to_dec
  160.     Endif
  161.     If Con_char%
  162.       @Char_to_dec
  163.     Endif
  164.     @Driver_write
  165.     @Blank_array
  166.     @Blank_hold_array
  167.     Change_flag%=0
  168.   Endif
  169.   If Ex0%=Credo%
  170.     If Change_flag%
  171.       Swap Pd1$(),Pd$()
  172.       @Par_tran
  173.     Endif
  174.     @Make
  175.   Endif
  176.   If Ex0%=Cquit%
  177.     Sput Temp$
  178.     @Blank_array
  179.     @Blank_hold_array
  180.     Change_flag%=0
  181.   Endif
  182.   '
  183. Return
  184. '
  185. ' ==========================================================
  186. '
  187. Procedure Set1
  188.   '
  189.   @Sstate(Tree1%,Mquit%,0)
  190.   @Sstate(Tree1%,Mtitle%,0)
  191.   @Sstate(Tree1%,Mcreate%,0)
  192.   @Sstate(Tree1%,Medit%,0)
  193.   @Sstate(Tree1%,Mdelete%,0)
  194.   @Sstate(Tree1%,Mhard%,0)
  195.   @Sstate(Tree1%,Mpath%,0)
  196.   @Sstate(Tree1%,Mactive%,0)
  197.   @Sstate(Tree1%,Msetting%,0)
  198.   @Sstate(Tree1%,Mhex%,Con_hex%)
  199.   @Sstate(Tree1%,Mdec%,Con_dec%)
  200.   @Sstate(Tree1%,Mchar%,Con_char%)
  201.   '
  202. Return
  203. Procedure Dialog1
  204.   Do
  205.     @Objc_draw(Tree1%,0,6,X1%,Y1%,B1%,H1%)
  206.     @Form_do(Tree1%,0)
  207.     Ex1%=Dpeek(Gintout)
  208.     @Sstate(Tree1%,Ex1%,0)
  209.     Exit If Ex1%=1 Or (Ex1%>3 And Ex1%<8) Or Ex1%=9 Or (Ex1%>13 And Ex1%<17)
  210.   Loop
  211.   If Ex1%=Mquit%
  212.     @Form_dial(2,300,2,40,6*Rez%,X1%,Y1%,B1%,H1%)
  213.   Endif
  214.   Sput Temp$
  215.   '
  216. Return
  217. Procedure Translate1
  218.   '
  219.   @Gstate(Tree1%,Mhex%,*Con_hex%)
  220.   @Gstate(Tree1%,Mdec%,*Con_dec%)
  221.   @Gstate(Tree1%,Mchar%,*Con_char%)
  222.   '
  223.   On Ex1% Gosub Title_screen,Null,Null,Make,Change,File_delete,Hcopy,Null,Make_path,Null,Null,Null,Null,Make_active,Write_config,Leave
  224.   '
  225. Return
  226. '
  227. ' ============================================================
  228. '
  229. Procedure Set2
  230.   '
  231.   @Sstate(Tree2%,Dbutton%,0)
  232.   @Sstate(Tree2%,Pbutton%,0)
  233.   @Sstate(Tree2%,Nbutton%,0)
  234.   @Stext(Tree2%,Default%,Right$(Dpath$,37))
  235.   @Stext(Tree2%,Expath%,Right$(Present_path$+Path$,37))
  236.   @Stext(Tree2%,Newpath%,"")
  237.   '
  238. Return
  239. Procedure Dialog2
  240.   Do
  241.     @Objc_draw(Tree2%,0,6,X2%,Y2%,B2%,H2%)
  242.     @Form_do(Tree2%,3)
  243.     Ex2%=Dpeek(Gintout)
  244.     @Sstate(Tree2%,Ex2%,0)
  245.     Exit If Ex2%=Nbutton% Or Ex2%=Pbutton% Or Ex2%=Dbutton%
  246.   Loop
  247.   Sput Temp$
  248.   '
  249. Return
  250. Procedure Translate2
  251.   '
  252.   @Gtext(Tree2%,Default%,*Dpath$)
  253.   @Gtext(Tree2%,Newpath%,*Npath$)
  254.   If Ex2%=Nbutton%
  255.     Path$=Npath$
  256.   Endif
  257.   If Ex2%=Dbutton%
  258.     Path$=Dpath$
  259.   Endif
  260.   '
  261.   @Use_path
  262.   '
  263. Return
  264. '
  265. ' =============================================================
  266. '
  267. Procedure Set3
  268.   Antic$=Left$(Antic$,34)
  269.   @Sstate(Tree3%,Infobut%,0)
  270.   @Stext(Tree3%,Ttwo%,Antic$)
  271. Return
  272. '
  273. Procedure Dialog3
  274.   Do
  275.     If First_flag%
  276.       @Form_dial(1,300,2,40,1*Rez%,X3%,Y3%,B3%,H3%)
  277.       First_flag%=0
  278.     Endif
  279.     @Objc_draw(Tree3%,0,6,X3%,Y3%,B3%,H3%)
  280.     @Form_do(Tree3%,0)
  281.     Ex3%=Dpeek(Gintout)
  282.     @Sstate(Tree3%,Ex3%,0)
  283.     Exit If Ex3%=Infobut%
  284.   Loop
  285.   Sput Temp$
  286.   '
  287. Return
  288. '
  289. ' ===============================================================
  290. Procedure Objc_draw(Tree%,Start%,Depth%,X%,Y%,B%,H%)
  291.   Lpoke Addrin,Tree%
  292.   Dpoke Gintin,Start%
  293.   Dpoke Gintin+2,Depth%
  294.   Dpoke Gintin+4,X%
  295.   Dpoke Gintin+6,Y%
  296.   Dpoke Gintin+8,B%
  297.   Dpoke Gintin+10,H%
  298.   Gemsys 42
  299. Return
  300. Procedure Form_do(Tree%,Start%)
  301.   Lpoke Addrin,Tree%
  302.   Dpoke Gintin,Start%
  303.   Gemsys 50
  304. Return
  305. Procedure Form_dial(F%,X%,Y%,B%,H%,Xb%,Yb%,Bb%,Hb%)
  306.   Dpoke Gintin,F%
  307.   Dpoke Gintin+2,X%
  308.   Dpoke Gintin+4,Y%
  309.   Dpoke Gintin+6,B%
  310.   Dpoke Gintin+8,H%
  311.   Dpoke Gintin+10,Xb%
  312.   Dpoke Gintin+12,Yb%
  313.   Dpoke Gintin+14,Bb%
  314.   Dpoke Gintin+16,Hb%
  315.   Gemsys 51
  316. Return
  317. Procedure Form_center(Tree%)
  318.   Lpoke Addrin,Tree%
  319.   Gemsys 54
  320. Return
  321. Procedure Rsrc_load(Nam$)
  322.   If Not Exist(Nam$)
  323.     Alert 3,"The file "+Nam$+" must|be in the same directory|as DRIVER.PRG.",1,"Abort",D
  324.     @Restore_pal
  325.     @Memory_back
  326.     Cls
  327.     Edit
  328.   Endif
  329.   Nam$=Nam$+Chr$(0)
  330.   Lpoke Addrin,Varptr(Nam$)
  331.   Gemsys 110
  332.   R_load_flag%=1
  333. Return
  334. Procedure Rsrc_free
  335.   Gemsys 111
  336. Return
  337. Procedure Rsrc_gaddr(Type%,Index%)
  338.   Dpoke Gintin,Type%
  339.   Dpoke Gintin+2,Index%
  340.   Gemsys 112
  341. Return
  342. Procedure Rsrc_gtree(Index_%,Tree.%)
  343.   Lpoke Gintin,Index_%
  344.   Gemsys 112
  345.   *Tree.%=Lpeek(Addrout)
  346. Return
  347. '
  348. Procedure Gstate(T_%,N_%,X.%)
  349.   *X.%=Dpeek(T_%+24*N_%+10)
  350. Return
  351. '
  352. Procedure Sstate(T_%,N_%,X_%)
  353.   Dpoke T_%+24*N_%+10,X_%
  354. Return
  355. '
  356. Procedure Gtext(T_%,N_%,X.%)
  357.   Local X_$
  358.   X_$=Space$(100)
  359.   T_%=Lpeek(Lpeek(T_%+24*N_%+12))
  360.   Bmove T_%,Varptr(X_$),100
  361.   *X.%=Left$(X_$,Instr(X_$,Chr$(0))-1)
  362. Return
  363. '
  364. Procedure Stext(T_%,N_%,X_$)
  365.   X_$=X_$+Chr$(0)
  366.   T_%=Lpeek(T_%+24*N_%+12)
  367.   Bmove Varptr(X_$),Lpeek(T_%),Min(Len(X_$),Dpeek(T_%+24)-1)
  368. Return
  369. '
  370. Procedure Memory
  371.   Reserve Fre(0)-10000
  372. Return
  373. '
  374. Procedure Memory_back
  375.   Reserve Fre(0)+10000-255
  376.   Void Fre(0)
  377. Return
  378. '
  379. Procedure Assign
  380.   '
  381.   Present_path$=" Present Path: "
  382.   '
  383.   '
  384.   Choose%=0 !RSC_TREE
  385.   Ctitle%=1 !Obj in #0
  386.   Cname%=2 !Obj in #0
  387.   Clbox%=3 !Obj in #0
  388.   Calign%=4 !Obj in #0
  389.   Clinef%=5 !Obj in #0
  390.   Cformf%=6 !Obj in #0
  391.   Cpagel%=7 !Obj in #0
  392.   Citalon%=8 !Obj in #0
  393.   Citaloff%=9 !Obj in #0
  394.   Cboldon%=10 !Obj in #0
  395.   Cboldoff%=11 !Obj in #0
  396.   Cdblson%=12 !Obj in #0
  397.   Cdblsoff%=13 !Obj in #0
  398.   Cundron%=14 !Obj in #0
  399.   Cundroff%=15 !Obj in #0
  400.   Rtmar1%=16 !Obj in #0
  401.   Crbox%=17 !Obj in #0
  402.   Csubon%=18 !Obj in #0
  403.   Csupon%=19 !Obj in #0
  404.   Csuboff%=20 !Obj in #0
  405.   Cwideon%=21 !Obj in #0
  406.   Cwideoff%=22 !Obj in #0
  407.   Cnlq%=23 !Obj in #0
  408.   Cdraft%=24 !Obj in #0
  409.   C10cpi%=25 !Obj in #0
  410.   C12cpi%=26 !Obj in #0
  411.   C17cpi%=27 !Obj in #0
  412.   C6lpi%=28 !Obj in #0
  413.   C8lpi%=29 !Obj in #0
  414.   Rtmar2%=30 !Obj in #0
  415.   Cquit%=31 !Obj in #0
  416.   Credo%=32 !Obj in #0
  417.   Caccept%=33 !Obj in #0
  418.   '
  419.   Mpanel%=1 !RSC_TREE
  420.   Mtitle%=1 !Obj in #1
  421.   Blurb%=2 !Obj in #1
  422.   Mlbox%=3 !Obj in #1
  423.   Mcreate%=4 !Obj in #1
  424.   Medit%=5 !Obj in #1
  425.   Mdelete%=6 !Obj in #1
  426.   Mhard%=7 !Obj in #1
  427.   Mrbox%=8 !Obj in #1
  428.   Mpath%=9 !Obj in #1
  429.   Display%=10 !Obj in #1
  430.   Mhex%=11 !Obj in #1
  431.   Mdec%=12 !Obj in #1
  432.   Mchar%=13 !Obj in #1
  433.   Mactive%=14 !Obj in #1
  434.   Msetting%=15 !Obj in #1
  435.   Mquit%=16 !Obj in #1
  436.   '
  437.   Pathbox%=2 !RSC_TREE
  438.   Ptitle%=1 !Obj in #2
  439.   Expath%=2 !Obj in #2
  440.   Let Newpath%=3 !Obj in #2
  441.   Default%=4 !Obj in #2
  442.   Dbutton%=5 !Obj in #2
  443.   Pbutton%=6 !Obj in #2
  444.   Nbutton%=7 !Obj in #2
  445.   '
  446.   Info%=3 !RSC_TREE
  447.   Inborder%=1 !Obj in #3
  448.   Tone%=2 !Obj in #3
  449.   Ttwo%=3 !Obj in #3
  450.   Tthree%=4 !Obj in #3
  451.   Tfour%=5 !Obj in #3
  452.   Tfive%=6 !Obj in #3
  453.   Tsix%=7 !Obj in #3
  454.   Infobut%=8 !Obj in #3
  455.   '
  456.   If Rez%=2
  457.     @Rsrc_load("DRIVERH.RSC")
  458.   Else
  459.     @Rsrc_load("DRIVERM.RSC")
  460.   Endif
  461.   @Rsrc_gtree(Choose%,*Tree0%)
  462.   @Rsrc_gtree(Mpanel%,*Tree1%)
  463.   @Rsrc_gtree(Pathbox%,*Tree2%)
  464.   @Rsrc_gtree(Info%,*Tree3%)
  465.   '
  466.   @Form_center(Tree0%)
  467.   X0%=Dpeek(Tree0%+16)
  468.   Y0%=Dpeek(Tree0%+18)
  469.   B0%=Dpeek(Tree0%+20)
  470.   H0%=Dpeek(Tree0%+22)
  471.   '
  472.   @Form_center(Tree1%)
  473.   X1%=Dpeek(Tree1%+16)
  474.   Y1%=Dpeek(Tree1%+18)
  475.   B1%=Dpeek(Tree1%+20)
  476.   H1%=Dpeek(Tree1%+22)
  477.   '
  478.   @Form_center(Tree2%)
  479.   X2%=Dpeek(Tree2%+16)
  480.   Y2%=Dpeek(Tree2%+18)
  481.   B2%=Dpeek(Tree2%+20)
  482.   H2%=Dpeek(Tree2%+22)
  483.   '
  484.   @Form_center(Tree3%)
  485.   X3%=Dpeek(Tree3%+16)
  486.   Y3%=Dpeek(Tree3%+18)
  487.   B3%=Dpeek(Tree3%+20)
  488.   H3%=Dpeek(Tree3%+22)
  489.   '
  490. Return
  491. '
  492. ' =============================================
  493. '
  494. Procedure Read_config
  495.   Drive=Gemdos(&H19)
  496.   Let Dir$=Dir$(Drive+1)
  497.   If Right$(Dir$,1)<>"\"
  498.     Let Dir$=Dir$+"\"
  499.   Endif
  500.   Let Dir$=Mid$("ABCDEFGHIJKLMNOP",Drive+1,1)+":"+Dir$
  501.   Cfg_name$=Dir$+"DRIVER.CFG"
  502.   '
  503.   If Exist(Cfg_name$)=0
  504.     Open "O",#1,Cfg_name$
  505.     Write #1,Dir$
  506.     Write #1,Dir$
  507.     Write #1,0
  508.     Write #1,1
  509.     Write #1,0
  510.     Close #1
  511.   Endif
  512.   Open "I",#1,Cfg_name$
  513.   Input #1,Path$
  514.   Input #1,Dpath$
  515.   Input #1,Con_hex%
  516.   Input #1,Con_dec%
  517.   Input #1,Con_char%
  518.   Close #1
  519. Return
  520. '
  521. Procedure Write_config
  522.   Sput Temp$
  523.   @Notice_box("Writing Current Settings","to: "+Cfg_name$)
  524.   Open "O",#1,Cfg_name$
  525.   Write #1,Path$
  526.   Write #1,Dpath$
  527.   Write #1,Con_hex%
  528.   Write #1,Con_dec%
  529.   Write #1,Con_char%
  530.   Close #1
  531.   Sput Temp$
  532. Return
  533. '
  534. ' ======================================================
  535. '
  536. Procedure Gem_to_string
  537.   @Gtext(Tree0%,Cname%,*Capture$)
  538.   Pd$(2)=Capture$
  539.   '
  540.   I%=3
  541.   Repeat
  542.     Inc I%
  543.     @Gtext(Tree0%,I%,*Capture$)
  544.     Pd$(I%)=Capture$
  545.     @Gtext(Tree0%,I%+14,*Capture$)
  546.     Pd$(I%+14)=Capture$
  547.   Until I%=16
  548.   '
  549. Return
  550. '
  551. Procedure Dec_to_hex
  552.   I%=3
  553.   Repeat
  554.     Inc I%
  555.     @Dec_convert
  556.   Until I%=16
  557.   I%=17
  558.   Repeat
  559.     Inc I%
  560.     @Dec_convert
  561.   Until I%=30
  562. Return
  563. '
  564. Procedure Dec_convert
  565.   Jend%=Len(Pd$(I%))
  566.   J%=0
  567.   Hexhold$=""
  568.   If Jend%>0
  569.     While J%<=Jend%
  570.       Do
  571.         Inc J%
  572.         Exit If J%>Jend%
  573.         Holdit$=Mid$(Pd$(I%),J%,1)
  574.         Exit If Holdit$=","
  575.         Hold$=Hold$+Holdit$
  576.       Loop
  577.       Hold$=Hex$(Val(Hold$))
  578.       If Len(Hold$)=1
  579.         Hold$="0"+Hold$
  580.       Endif
  581.       Hexhold$=Hexhold$+Hold$+","
  582.       Hold$=""
  583.     Wend
  584.     Pd$(I%)=Left$(Hexhold$,Len(Hexhold$)-1)
  585.   Else
  586.     Pd$(I%)=""
  587.   Endif
  588. Return
  589. '
  590. Procedure Hex_to_dec
  591.   I%=3
  592.   Repeat
  593.     Inc I%
  594.     @Hex_convert
  595.   Until I%=16
  596.   I%=17
  597.   Repeat
  598.     Inc I%
  599.     @Hex_convert
  600.   Until I%=30
  601. Return
  602. '
  603. Procedure Hex_convert
  604.   Jend%=Len(Pd$(I%))
  605.   J%=0
  606.   Hexhold$=""
  607.   If Jend%>0
  608.     While J%<=Jend%
  609.       Do
  610.         Inc J%
  611.         Exit If J%>Jend%
  612.         Holdit$=Mid$(Pd$(I%),J%,1)
  613.         Exit If Holdit$=","
  614.         Hold$=Hold$+Holdit$
  615.       Loop
  616.       If Left$(Hold$,1)="#"
  617.         Hold$=Right$(Hold$,Len(Hold$)-1)
  618.         Hexhold$=Hexhold$+Hold$+","
  619.       Else
  620.         Hold$="&"+Hold$
  621.         Hexhold$=Hexhold$+Str$(Val(Hold$))+","
  622.       Endif
  623.       Hold$=""
  624.     Wend
  625.     Pd$(I%)=Left$(Hexhold$,Len(Hexhold$)-1)
  626.   Else
  627.     Pd$(I%)=""
  628.   Endif
  629. Return
  630. '
  631. Procedure Char_to_dec
  632.   I%=3
  633.   Repeat
  634.     Inc I%
  635.     @Char_convert
  636.   Until I%=16
  637.   I%=17
  638.   Repeat
  639.     Inc I%
  640.     @Char_convert
  641.   Until I%=30
  642. Return
  643. '
  644. Procedure Char_convert
  645.   Jend%=Len(Pd$(I%))
  646.   J%=0
  647.   Charhold$=""
  648.   If Jend%>0
  649.     While J%<=Jend%
  650.       Do
  651.         Inc J%
  652.         Exit If J%>Jend%
  653.         Holdit$=Mid$(Pd$(I%),J%,1)
  654.         Exit If Holdit$=","
  655.         Hold$=Hold$+Holdit$
  656.       Loop
  657.       '
  658.       If Len(Hold$)=1 And Asc(Hold$)>32
  659.         Hold$=Str$(Asc(Hold$))
  660.       Else
  661.         Uhold$=Upper$(Hold$)
  662.         If Uhold$="NUL"
  663.           Hold$="0"
  664.         Endif
  665.         If Uhold$="SOH"
  666.           Hold$="1"
  667.         Endif
  668.         If Uhold$="BEL"
  669.           Hold$="7"
  670.         Endif
  671.         If Uhold$="BS"
  672.           Hold$="8"
  673.         Endif
  674.         If Uhold$="HT"
  675.           Hold$="9"
  676.         Endif
  677.         If Uhold$="LF"
  678.           Hold$="10"
  679.         Endif
  680.         If Uhold$="VT"
  681.           Hold$="11"
  682.         Endif
  683.         If Uhold$="FF"
  684.           Hold$="12"
  685.         Endif
  686.         If Uhold$="CR"
  687.           Hold$="13"
  688.         Endif
  689.         If Uhold$="SO"
  690.           Hold$="14"
  691.         Endif
  692.         If Uhold$="SI"
  693.           Hold$="15"
  694.         Endif
  695.         If Uhold$="DC1"
  696.           Hold$="17"
  697.         Endif
  698.         If Uhold$="DC2"
  699.           Hold$="18"
  700.         Endif
  701.         If Uhold$="DC3"
  702.           Hold$="19"
  703.         Endif
  704.         If Uhold$="DC4"
  705.           Hold$="20"
  706.         Endif
  707.         If Uhold$="CAN"
  708.           Hold$="24"
  709.         Endif
  710.         If Uhold$="ESC"
  711.           Hold$="27"
  712.         Endif
  713.         If Uhold$="SP"
  714.           Hold$="32"
  715.         Endif
  716.         If Left$(Hold$,1)="#"
  717.           Hold$=Mid$(Hold$,2,Len(Hold$)-1)
  718.         Endif
  719.       Endif
  720.       '
  721.       Charhold$=Charhold$+Hold$+","
  722.       Hold$=""
  723.     Wend
  724.     Pd$(I%)=Left$(Charhold$,Len(Charhold$)-1)
  725.   Else
  726.     Pd$(I%)=""
  727.   Endif
  728. Return
  729. '
  730. Procedure Dec_to_char
  731.   I%=3
  732.   Repeat
  733.     Inc I%
  734.     @Cd_convert
  735.   Until I%=16
  736.   I%=17
  737.   Repeat
  738.     Inc I%
  739.     @Cd_convert
  740.   Until I%=30
  741. Return
  742. '
  743. Procedure Cd_convert
  744.   Jend%=Len(Pd$(I%))
  745.   J%=0
  746.   Charhold$=""
  747.   If Jend%>0
  748.     While J%<=Jend%
  749.       Do
  750.         Inc J%
  751.         Exit If J%>Jend%
  752.         Holdit$=Mid$(Pd$(I%),J%,1)
  753.         Exit If Holdit$=","
  754.         Hold$=Hold$+Holdit$
  755.       Loop
  756.       '
  757.       Vh%=Val(Hold$)
  758.       If Vh%<33 And ((Vh%>-1 And Vh%<2) Or (Vh%>6 And Vh%<16) Or (Vh%>16 And Vh%<21) Or (Vh%=24) Or (Vh%=27) Or (Vh%=32))
  759.         If Hold$="0"
  760.           Hold$="NUL"
  761.         Endif
  762.         If Hold$="1"
  763.           Hold$="SOH"
  764.         Endif
  765.         If Hold$="7"
  766.           Hold$="BEL"
  767.         Endif
  768.         If Hold$="8"
  769.           Hold$="BS"
  770.         Endif
  771.         If Hold$="9"
  772.           Hold$="HT"
  773.         Endif
  774.         If Hold$="10"
  775.           Hold$="LF"
  776.         Endif
  777.         If Hold$="11"
  778.           Hold$="VT"
  779.         Endif
  780.         If Hold$="12"
  781.           Hold$="FF"
  782.         Endif
  783.         If Hold$="13"
  784.           Hold$="CR"
  785.         Endif
  786.         If Hold$="14"
  787.           Hold$="SO"
  788.         Endif
  789.         If Hold$="15"
  790.           Hold$="SI"
  791.         Endif
  792.         If Hold$="17"
  793.           Hold$="DC1"
  794.         Endif
  795.         If Hold$="18"
  796.           Hold$="DC2"
  797.         Endif
  798.         If Hold$="19"
  799.           Hold$="DC3"
  800.         Endif
  801.         If Hold$="20"
  802.           Hold$="DC4"
  803.         Endif
  804.         If Hold$="24"
  805.           Hold$="CAN"
  806.         Endif
  807.         If Hold$="27"
  808.           Hold$="ESC"
  809.         Endif
  810.         If Hold$="32"
  811.           Hold$="SP"
  812.         Endif
  813.       Else
  814.         Hold$=Chr$(Val(Hold$))
  815.       Endif
  816.       '
  817.       Charhold$=Charhold$+Hold$+","
  818.       Hold$=""
  819.     Wend
  820.     Pd$(I%)=Left$(Charhold$,Len(Charhold$)-1)
  821.   Else
  822.     Pd$(I%)=""
  823.   Endif
  824. Return
  825. '
  826. ' =====================================================
  827. '
  828. Procedure Notice_box(Dt$,Filename$)
  829.   '
  830.   Local Sx%,Sy%,Ex%,Ey%,Ldt%,Lfname%
  831.   Ldt%=Len(Dt$)
  832.   Lfname%=Len(Filename$)
  833.   '
  834.   Mlen%=((Max(Ldt%,Lfname%))*8)+60
  835.   Dif%=(640-Mlen%)/2
  836.   Sx%=Dif%
  837.   Sy%=60*Rez%
  838.   Ex%=640-Dif%
  839.   Ey%=140*Rez%
  840.   '
  841.   Deffill 0,1,0
  842.   Pbox Sx%,Sy%,Ex%,Ey%
  843.   Box Sx%,Sy%,Ex%,Ey%
  844.   Defline 1,3,0,0
  845.   Box Sx%+6,Sy%+4,Ex%-6,Ey%-4
  846.   Line Sx%+4,Sy%+4,Sx%+6,Sy%+4
  847.   Center%=((80-Ldt%)/2)+1
  848.   Print At(Center%,11);Dt$
  849.   Center%=((80-Lfname%)/2)+1
  850.   Print At(Center%,14);Filename$
  851.   '
  852.   Defline 1,1,0,0
  853. Return
  854. '
  855. ' ========================================================
  856. '
  857. Procedure Driver_pick
  858.   '
  859.   If Upath$=""
  860.     @Find_path("\*.PD?")
  861.   Else
  862.     D$=Upath$+"*.PD?"
  863.   Endif
  864.   @Select_file
  865. Return
  866. '
  867. Procedure Driver_load
  868.   Tail_check$=Upper$(Right$(Pfilename$,3))
  869.   If Pfilename$<>"" And (Tail_check$="PDA" Or Tail_check$="PDX")
  870.     Defmouse 2
  871.     @Notice_box("Loading Printer Driver:",Pfilename$)
  872.     @Blank_array
  873.     @Driver_read
  874.     Defmouse 0
  875.     Sput Temp$
  876.   Endif
  877.   '
  878. Return
  879. '
  880. ' ===========================================================
  881. '
  882. Procedure Find_path(Tail$)
  883.   Path_name$=Dir$(0)
  884.   Drive=Gemdos(&H19)
  885.   Drive$=Chr$(Drive+65)
  886.   D$=Drive$+":"+Path_name$+Tail$
  887. Return
  888. '
  889. '
  890. Procedure Select_file
  891.   Fileselect D$,B$,Pfilename$
  892.   If Pfilename$<>""
  893.     If Exist(Pfilename$)=0
  894.       Alrt$="|  File doesn't exist!"
  895.       Alert 1,Alrt$,1," O.K. ",B%
  896.       Pfilename$=""
  897.     Endif
  898.   Else
  899.     Pfilename$=""
  900.   Endif
  901. Return
  902. '
  903. '
  904. Procedure File_delete
  905.   '
  906.   If Upath$=""
  907.     @Find_path("\*.*")
  908.   Else
  909.     D$=Upath$+"*.*"
  910.   Endif
  911.   @Select_file
  912.   If Pfilename$<>""
  913.     B%=0
  914.     If Exist(Pfilename$) And Len(Pfilename$)>5
  915.       Del1$=Right$(Pfilename$,30)
  916.       Alrt$="Are you SURE about deleting| |"+Del1$
  917.       Alert 3,Alrt$,2,"DELETE|CANCEL",B%
  918.     Endif
  919.     If B%=1
  920.       Defmouse 2
  921.       @Notice_box("Deleting File:",Pfilename$)
  922.       Kill Pfilename$
  923.       Defmouse 0
  924.       Pfilename$=""
  925.       Sput Temp$
  926.     Endif
  927.   Endif
  928.   '
  929. Return
  930. '
  931. ' =============================================================
  932. Procedure Driver_read
  933.   Tail_check$=Upper$(Right$(Pfilename$,3))
  934.   If Pfilename$<>"" And (Tail_check$="PDA" Or Tail_check$="PDX")
  935.     Open "I",#1,Pfilename$
  936.     For I%=4 To 16
  937.       Line Input #1,Pd$(I%)
  938.     Next I%
  939.     For I%=18 To 30
  940.       Line Input #1,Pd$(I%)
  941.     Next I%
  942.     Close #1
  943.     '
  944.     Rhold%=0
  945.     Rphold%=0
  946.     Repeat
  947.       Rhold%=Instr(Rphold%+1,Pfilename$,"\")
  948.       Rphold%=Max(Rphold%,Rhold%)
  949.     Until Rhold%=0
  950.     Pd$(2)=Right$(Pfilename$,Len(Pfilename$)-Rphold%)
  951.     Pd$(2)=Left$(Pd$(2),Len(Pd$(2))-4)
  952.   Endif
  953. Return
  954. '
  955. Procedure Par_tran
  956.   I%=0
  957.   Repeat
  958.     Inc I%
  959.     Pd1$(I%)=Pd$(I%)
  960.   Until I%=30
  961. Return
  962. '
  963. ' ===============================================================
  964. '
  965. Procedure Driver_write
  966.   If Len(Pd$(2))=0
  967.     Pd$(2)="UNKNOWN"
  968.   Endif
  969.   @Use_path
  970.   Pfilename$=Upath$+Pd$(2)+".PDX"
  971.   Defmouse 2
  972.   Afilename$=Pfilename$
  973.   Mid$(Afilename$,Len(Afilename$)-2)="PDA"
  974.   If Exist(Afilename$)
  975.     Name Afilename$ As Pfilename$
  976.   Endif
  977.   '
  978.   If Exist(Pfilename$)
  979.     Filebak$=Pfilename$
  980.     Mid$(Filebak$,Len(Filebak$)-2)="BAK"
  981.     If Exist(Filebak$)
  982.       Kill Filebak$
  983.     Endif
  984.     Name Pfilename$ As Filebak$
  985.   Endif
  986.   @Notice_box("Saving Printer Driver:",Pfilename$)
  987.   Open "O",#1,Pfilename$
  988.   For I%=4 To 16
  989.     Print #1,Pd$(I%)
  990.   Next I%
  991.   For I%=18 To 30
  992.     Print #1,Pd$(I%)
  993.   Next I%
  994.   Close #1
  995.   Defmouse 0
  996.   Sput Temp$
  997.   @Blank_array
  998. Return
  999. '
  1000. Procedure Blank_array
  1001.   I%=-1
  1002.   Repeat
  1003.     Inc I%
  1004.     Pd$(I%)=""
  1005.   Until I%=30
  1006. Return
  1007. '
  1008. Procedure Blank_hold_array
  1009.   I%=-1
  1010.   Repeat
  1011.     Inc I%
  1012.     Pd1$(I%)=""
  1013.   Until I%=30
  1014. Return
  1015. '
  1016. Procedure Active_show
  1017.   '
  1018.   If Upath$=""
  1019.     @Find_path("\*.PDA")
  1020.   Else
  1021.     D$=Upath$+"*.PDA"
  1022.   Endif
  1023. Return
  1024. '
  1025. Procedure Activate
  1026.   Sput Temp$
  1027.   Tail_check$=Upper$(Right$(Pfilename$,3))
  1028.   If Pfilename$<>"" And (Tail_check$="PDA" Or Tail_check$="PDX")
  1029.     Nname$=Pfilename$
  1030.     Rname$=Pfilename$
  1031.     Mid$(Rname$,Len(Rname$))="A"
  1032.     @Notice_box("Active Printer Driver:",Rname$)
  1033.     If Pfilename$<>Rname$
  1034.       Name Pfilename$ As Rname$
  1035.     Endif
  1036.     Rhold%=0
  1037.     Rphold%=0
  1038.     Repeat
  1039.       Rhold%=Instr(Rphold%+1,Nname$,"\")
  1040.       Rphold%=Max(Rphold%,Rhold%)
  1041.     Until Rhold%=0
  1042.     Rpath$=Left$(Nname$,Rphold%)
  1043.     Nname$=Rpath$+"*.PD?"
  1044.     Dir Nname$ To "TEMP1.ZZZ"
  1045.     Open "I",#1,"TEMP1.ZZZ"
  1046.     Do
  1047.       Line Input #1,Fhold$
  1048.       Fhold$=Upper$(Rpath$+Fhold$)
  1049.       Nhold$=Fhold$
  1050.       Mid$(Nhold$,Len(Nhold$))="X"
  1051.       If Fhold$<>Nhold$ And Fhold$<>Rname$
  1052.         Name Fhold$ As Nhold$
  1053.       Endif
  1054.       Exit If Eof(#1)
  1055.     Loop
  1056.     Close #1
  1057.     Kill "TEMP1.ZZZ"
  1058.     '
  1059.   Endif
  1060.   Sput Temp$
  1061. Return
  1062. '
  1063. ' ======================================================================
  1064. '
  1065. Procedure Get_driver
  1066.   @Active_show
  1067.   D_flag%=0
  1068.   Test_name$=Space$(20)
  1069.   Void Gemdos(26,L:Basepage+128)
  1070.   Fd$=D$+Chr$(0)
  1071.   E_%=Gemdos(78,L:Varptr(Fd$),Attr%)
  1072.   If E_%=0
  1073.     Open "I",#1,D$
  1074.     D_flag%=1
  1075.     Bmove Basepage+158,Varptr(Test_name$),14
  1076.     Test_name$=Left$(Test_name$,Instr(Test_name$,Chr$(0))-1)
  1077.   Endif
  1078.   @Para_to_char(*Align$)
  1079.   @Para_to_char(*Linef$)
  1080.   If D_flag%=0
  1081.     Let Linef$=Chr$(10)
  1082.   Endif
  1083.   @Para_to_char(*Formf$)
  1084.   If D_flag%=0
  1085.     Let Formf$=Chr$(12)
  1086.   Endif
  1087.   @Para_to_char(*Pagel$)
  1088.   @Para_to_char(*Italon$)
  1089.   @Para_to_char(*Italoff$)
  1090.   @Para_to_char(*Boldon$)
  1091.   @Para_to_char(*Boldoff$)
  1092.   @Para_to_char(*Dblon$)
  1093.   @Para_to_char(*Dbloff$)
  1094.   @Para_to_char(*Undron$)
  1095.   @Para_to_char(*Undroff$)
  1096.   @Para_to_char(*Rtmar1$)
  1097.   @Para_to_char(*Subon$)
  1098.   @Para_to_char(*Supon$)
  1099.   @Para_to_char(*Suboff$)
  1100.   @Para_to_char(*Wideon$)
  1101.   @Para_to_char(*Wideoff$)
  1102.   @Para_to_char(*Nlq$)
  1103.   @Para_to_char(*Draft$)
  1104.   @Para_to_char(*Cpi10$)
  1105.   @Para_to_char(*Cpi12$)
  1106.   @Para_to_char(*Cpi17$)
  1107.   @Para_to_char(*Lpi6$)
  1108.   @Para_to_char(*Lpi8$)
  1109.   @Para_to_char(*Rtmar2$)
  1110.   If D_flag%
  1111.     Close #1
  1112.   Endif
  1113. Return
  1114. '
  1115. ' ======================================================================
  1116. Procedure Para_to_char(Para_hold%)
  1117.   Local Hold$
  1118.   Local Holdit$
  1119.   If D_flag%
  1120.     Line Input #1,Ihold$
  1121.     Jend%=Len(Ihold$)
  1122.     J%=0
  1123.     Prhold$=""
  1124.     If Jend%>0
  1125.       While J%<=Jend%
  1126.         Do
  1127.           Inc J%
  1128.           Exit If J%>Jend%
  1129.           Holdit$=Mid$(Ihold$,J%,1)
  1130.           Exit If Holdit$=","
  1131.           Hold$=Hold$+Holdit$
  1132.         Loop
  1133.         Prhold$=Prhold$+Chr$(Val(Hold$))
  1134.         Hold$=""
  1135.       Wend
  1136.       *Para_hold%=Prhold$
  1137.     Else
  1138.       *Para_hold%=""
  1139.     Endif
  1140.   Else
  1141.     *Para_hold%=""
  1142.   Endif
  1143. Return
  1144. '
  1145. ' ==============================================================
  1146. '
  1147. Procedure Use_path
  1148.   Upath$=Path$
  1149.   If Path$=""
  1150.     Upath$=Dpath$
  1151.   Endif
  1152.   If Dpath$=""
  1153.     @Find_path("\")
  1154.     Upath$=Drive$+":"+Path_name$+Tail$
  1155.   Endif
  1156.   If Right$(Upath$,1)<>"\"
  1157.     Upath$=Upath$+"\"
  1158.   Endif
  1159. Return
  1160. '
  1161. ' ==============================================================
  1162. Procedure Fixit
  1163.   Mess$=""
  1164.   If Err=-33
  1165.     Mess$=Emess$(1)
  1166.   Endif
  1167.   If Err=-34
  1168.     Mess$=Emess$(2)
  1169.   Endif
  1170.   If Err=-36
  1171.     Mess$=Emess$(3)
  1172.   Endif
  1173.   If Err=-46
  1174.     Mess$=Emess$(4)
  1175.   Endif
  1176.   If Err=26
  1177.     Mess$=Emess$(5)
  1178.   Endif
  1179.   If Err=37
  1180.     Mess$=Emess$(6)
  1181.   Endif
  1182.   If Err=92
  1183.     Mess$=Emess$(7)
  1184.   Endif
  1185.   '
  1186.   If Mess$<>""
  1187.     Alrt$=Mess$
  1188.     Alert 3,Alrt$,0,"QUIT|CONTINUE",Er%
  1189.   Else
  1190.     Alrt$="Error #"+Str$(Err)+" | |Sorry !"
  1191.     Alert 3,Alrt$,1,"OOOPS!",Er%
  1192.   Endif
  1193.   Close
  1194.   If Er%=2
  1195.     Sput Temp$
  1196.     @Blank_array
  1197.     On Error Gosub Fixit
  1198.     Resume Entry
  1199.   Endif
  1200.   If Er%=1
  1201.     If R_load_flag%
  1202.       @Rsrc_free
  1203.     Endif
  1204.     @Restore_pal
  1205.     @Memory_back
  1206.     Edit
  1207.   Endif
  1208. Return
  1209. '
  1210. ' =============================================================
  1211. '
  1212. Procedure Print_list
  1213.   @Get_driver
  1214.   @Driver_pick
  1215.   @Driver_load
  1216.   @Driver_print
  1217. Return
  1218. '
  1219. Procedure Driver_print
  1220.   '
  1221.   Sput Temp$
  1222.   Tail_check$=Upper$(Right$(Pfilename$,3))
  1223.   If Pfilename$<>"" And (Tail_check$="PDA" Or Tail_check$="PDX")
  1224.     Title_data:
  1225.     Data "Align (Reset): ","Line Feed: ","Form Feed: ","Page Length: "
  1226.     Data "Italic Print On: ","Italic Print Off: ","Bold Print On: ","Bold Print Off: "
  1227.     Data "Double Strike On: ","Double Strike Off: ","Underline On: ","Underline Off: ","Right Margin 1: "
  1228.     Data "Subscript On: ","Superscript On: ","Sub/Superscript Off: ","Wide Print On: "
  1229.     Data "Wide Print Off: ","Nlq On: ","Draft On: ","10 Cpi: ","12 Cpi: ","17 Cpi: "
  1230.     Data "6 Lines/Inch: ","8 Lines/Inch: ","Right Margin 2: "
  1231.     '
  1232.     @Check_printer
  1233.     If Printer%
  1234.       '
  1235.       Alrt$=" |Align Paper to Top of Form"
  1236.       Alert 1,Alrt$,2,"O.K.|EXIT",B%
  1237.       If B%=1
  1238.         @Notice_box("Hardcopy of Driver:",Pfilename$)
  1239.         If Con_hex%
  1240.           @Dec_to_hex
  1241.         Endif
  1242.         If Con_char%
  1243.           @Dec_to_char
  1244.         Endif
  1245.         '
  1246.         Erase Tdata$()
  1247.         Dim Tdata$(26)
  1248.         Restore Title_data
  1249.         I%=0
  1250.         Repeat
  1251.           Inc I%
  1252.           Read Tdata$(I%)
  1253.         Until I%=26
  1254.         '
  1255.         I%=3
  1256.         Blank%=0
  1257.         Repeat
  1258.           Inc I%
  1259.           Blank%=Max(Blank%,Len(Pd$(I%)+Tdata$(I%-3)))
  1260.         Until I%=16
  1261.         '
  1262.         I%=17
  1263.         Blank2%=0
  1264.         Repeat
  1265.           Inc I%
  1266.           Blank2%=Max(Blank2%,Len(Pd$(I%)+Tdata$(I%-4)))
  1267.         Until I%=30
  1268.         '
  1269.         Full_len%=Max(Blank%,Blank2%)
  1270.         Half_flag%=0
  1271.         If Full_len%<31
  1272.           Half_flag%=1
  1273.           Col_lead$=Space$(35-Blank%)
  1274.           Back_space%=75-Blank2%
  1275.           Gap$=Space$(Back_space%-(Len(Col_lead$)+Blank%))
  1276.           I%=0
  1277.           Repeat
  1278.             Inc I%
  1279.             Pd$(I%+3)=Pd$(I%+3)+Space$(Blank%-(Len(Pd$(I%+3))+Len(Tdata$(I%))))
  1280.           Until I%=13
  1281.           '
  1282.         Else
  1283.           Col_lead$=Space$(Int((80-Full_len%)/2+1))
  1284.           Gap$=""
  1285.         Endif
  1286.         '
  1287.         Title_line$="GFA PRINTER DRIVER"
  1288.         Para_line$="PRINTER PARAMETERS FOR "+Pd$(2)
  1289.         Lead1%=(80-Len(Title_line$))/2+1
  1290.         Lead2%=(80-Len(Para_line$))/2+1
  1291.         Title_line$=Space$(Lead1%)+Title_line$
  1292.         Para_line$=Space$(Lead2%)+Para_line$
  1293.         '
  1294.         Lprint Align$;Pagel$;Draft$;Cpi10$;Lpi6$;
  1295.         Lprint Linef$
  1296.         Lprint Linef$
  1297.         Lprint Boldon$;
  1298.         Lprint Title_line$
  1299.         Lprint Linef$
  1300.         Lprint Para_line$
  1301.         Lprint Boldoff$;Cpi10$;Lpi6$;
  1302.         If Half_flag%
  1303.           Lprint Linef$
  1304.         Endif
  1305.         Lprint Linef$
  1306.         For I%=4 To 16
  1307.           If Half_flag%
  1308.             Lprint Col_lead$;Tdata$(I%-3);Boldon$;Pd$(I%);Boldoff$;Gap$;Tdata$(I%+10);Boldon$;Pd$(I%+14);Boldoff$
  1309.           Else
  1310.             Lprint Col_lead$;Tdata$(I%-3);Boldon$;Pd$(I%);Boldoff$
  1311.           Endif
  1312.           Lprint Linef$;
  1313.         Next I%
  1314.         If Half_flag%=0
  1315.           For I%=18 To 30
  1316.             Lprint Col_lead$;Tdata$(I%-4);Boldon$;Pd$(I%);Boldoff$
  1317.             Lprint Linef$;
  1318.           Next I%
  1319.         Endif
  1320.         Lprint Formf$;
  1321.         Lprint Align$;
  1322.         Erase Tdata$()
  1323.         Sput Temp$
  1324.       Endif
  1325.     Endif
  1326.   Endif
  1327.   @Blank_array
  1328. Return
  1329. '
  1330. ' =============================================================
  1331. '
  1332. Procedure Print_test
  1333.   @Check_printer
  1334.   If Printer%
  1335.     @Get_driver
  1336.     If D_flag%
  1337.       @Check_printer
  1338.       If Printer%
  1339.         '
  1340.         Alrt$=" |Align Paper to Top of Form"
  1341.         Alert 1,Alrt$,2,"O.K.|EXIT",B%
  1342.         If B%=1
  1343.           @Notice_box("Running Driver Test:",Test_name$)
  1344.           If Con_hex%
  1345.             @Dec_to_hex
  1346.           Endif
  1347.           If Con_char%
  1348.             @Dec_to_char
  1349.           Endif
  1350.           @Test_form
  1351.         Endif
  1352.       Endif
  1353.     Else
  1354.       Alrt$="No Active Driver Has Been|Found. Make a Driver Active|Before Running This Test."
  1355.       Alert 3,Alrt$,1," O.K. ",B%
  1356.     Endif
  1357.   Endif
  1358.   '
  1359. Return
  1360. '
  1361. Procedure Test_form
  1362.   Let Line80$=String$(80,"-")
  1363.   Lprint Align$;Pagel$;Draft$;Cpi10$;Lpi6$;
  1364.   Lprint "-----------------------THIS IS THE FIRST LINE ON THE PAGE----------------------"
  1365.   For I%=1 To 3
  1366.     Lprint
  1367.   Next I%
  1368.   Lprint "Testing Printer Driver: ";Test_name$
  1369.   Lprint
  1370.   Lprint "6 LPI, 10 CPI, DRAFT"
  1371.   @Test_lines
  1372.   Lprint
  1373.   Lprint Draft$;Lpi6$;Cpi12$;
  1374.   Lprint "6 LPI, 12 CPI, DRAFT"
  1375.   @Test_lines
  1376.   Lprint
  1377.   Lprint Draft$;Lpi6$;Cpi17$;
  1378.   Lprint "6 LPI, 17 CPI, DRAFT"
  1379.   @Test_lines
  1380.   Lprint
  1381.   Lprint Nlq$;Lpi6$;Cpi10$;
  1382.   Lprint "6 LPI, 10 CPI, NLQ"
  1383.   @Test_lines
  1384.   Lprint
  1385.   Lprint Nlq$;Lpi6$;Cpi12$;
  1386.   Lprint "6 LPI, 12 CPI, NLQ"
  1387.   @Test_lines
  1388.   Lprint
  1389.   Lprint Nlq$;Lpi6$;Cpi17$;
  1390.   Lprint "6 LPI, 17 CPI, NLQ"
  1391.   @Test_lines
  1392.   Lprint
  1393.   Lprint Draft$;Cpi10$;Lpi6$;
  1394.   @Test_lines2
  1395.   Lprint
  1396.   Lprint "6 LPI, 1 INCH SPACED LINES"
  1397.   Lprint Line80$
  1398.   For J%=1 To 3
  1399.     For I%=1 To 5
  1400.       Lprint
  1401.     Next I%
  1402.     Lprint Line80$
  1403.   Next J%
  1404.   Lprint Formf$;
  1405.   ' ==================================================================
  1406.   Lprint Align$;Pagel$;Draft$;Lpi8$;Cpi10$;
  1407.   Lprint "--------------------THIS IS THE FIRST LINE ON THE SECOND PAGE-------------------"
  1408.   For I%=1 To 5
  1409.     Lprint
  1410.   Next I%
  1411.   Lprint "Testing Printer Driver: ";Test_name$
  1412.   Lprint
  1413.   Lprint "8 LPI, 10 CPI, DRAFT"
  1414.   @Test_lines
  1415.   Lprint
  1416.   Lprint Draft$;Lpi8$;Cpi12$;
  1417.   Lprint "8 LPI, 12 CPI, DRAFT"
  1418.   @Test_lines
  1419.   Lprint
  1420.   Lprint Draft$;Lpi8$;Cpi17$;
  1421.   Lprint "8 LPI, 17 CPI, DRAFT"
  1422.   @Test_lines
  1423.   Lprint
  1424.   Lprint Nlq$;Lpi8$;Cpi10$;
  1425.   Lprint "8 LPI, 10 CPI, NLQ"
  1426.   @Test_lines
  1427.   Lprint
  1428.   Lprint Nlq$;Lpi8$;Cpi12$;
  1429.   Lprint "8 LPI, 12 CPI, NLQ"
  1430.   @Test_lines
  1431.   Lprint
  1432.   Lprint Nlq$;Lpi8$;Cpi17$;
  1433.   Lprint "8 LPI, 17 CPI, NLQ"
  1434.   @Test_lines
  1435.   Lprint
  1436.   Lprint Draft$;Cpi10$;Lpi8$;
  1437.   @Test_lines2
  1438.   Lprint
  1439.   Lprint "8 LPI, 1 INCH SPACED LINES"
  1440.   Lprint Line80$
  1441.   For J%=1 To 3
  1442.     For I%=1 To 7
  1443.       Lprint
  1444.     Next I%
  1445.     Lprint Line80$
  1446.   Next J%
  1447.   Lprint Formf$;
  1448.   Lprint Align$;Cpi10$;Draft$;Lpi6$;
  1449. Return
  1450. '
  1451. Procedure Test_lines
  1452.   Lprint "0123456789!@#$%^&*()-+='./?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  1453.   Lprint "0123456789!@#$%^&*()-+='./?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  1454. Return
  1455. '
  1456. Procedure Test_lines2
  1457.   Lprint Italon$;"Italic Print";Italoff$
  1458.   Lprint Boldon$;"Bold Print";Boldoff$
  1459.   Lprint Dblon$;"Double Strike";Dbloff$
  1460.   Lprint Undron$;"Underline";Undroff$
  1461.   Lprint Subon$;"Subscript";Suboff$
  1462.   Lprint Supon$;"Superscript";Suboff$
  1463.   Lprint Wideon$;"Wide Print";Wideoff$
  1464. Return
  1465. '
  1466. ' =============================================================
  1467. '
  1468. Procedure Check_printer
  1469.   Repeat
  1470.     B%=1
  1471.     Let Printer%=Gemdos(17)
  1472.     If Printer%=0
  1473.       Alrt$="No Printer is Detected.|Turn it on, or|check the cables !"
  1474.       Alert 2,Alrt$,0,"O.K.|EXIT",B%
  1475.     Endif
  1476.   Until (B%=1 And Printer%) Or B%=2
  1477.   If B%=2
  1478.     Let Printer%=0
  1479.   Endif
  1480. Return
  1481. '
  1482. ' ------------- SAVE ORIGINAL COLOR PALETTE -----------------------
  1483. Procedure Save_pal
  1484.   '
  1485.   Dim Spalette%(16,3)
  1486.   '
  1487.   For Z%=0 To 15
  1488.     Dpoke Contrl,26
  1489.     Dpoke Contrl+2,0
  1490.     Dpoke Contrl+6,2
  1491.     Dpoke Intin,Z%
  1492.     Dpoke Intin+2,0
  1493.     Vdisys
  1494.     Spalette%(Z%,0)=Dpeek(Intout+2)
  1495.     Spalette%(Z%,1)=Dpeek(Intout+4)
  1496.     Spalette%(Z%,2)=Dpeek(Intout+6)
  1497.   Next Z%
  1498. Return
  1499. '
  1500. Procedure Restore_pal
  1501.   ' --------------------- RESTORES PALETTE -------------------
  1502.   ' Dimensions: Spalette%(16,3)
  1503.   '
  1504.   For Z%=0 To 15
  1505.     Dpoke Contrl,14
  1506.     Dpoke Contrl+2,0
  1507.     Dpoke Contrl+6,4
  1508.     Dpoke Intin,Z%
  1509.     Dpoke Intin+2,Spalette%(Z%,0)
  1510.     Dpoke Intin+4,Spalette%(Z%,1)
  1511.     Dpoke Intin+6,Spalette%(Z%,2)
  1512.     Vdisys
  1513.   Next Z%
  1514. Return
  1515. '
  1516. ' #######################################################################
  1517.